import util from '../libs/util';
const fetch = util.ajax;

// 文章列表API
export function pageArticles(data) {
    return fetch({
        url: '/blog/article/page',
        method: 'get',
        params: data
    })
}

// 文章列表API
export function qryArticles(data) {
    return fetch({
        url: '/blog/article/list',
        method: 'get',
        params: data
    })
}
//文章搜索API
export function searchArticles(data) {
    return fetch({
        url: '/blog/article/search',
        method: 'get',
        params: data
    })
}
//新增文章API
export function addArticle(data) {
    return fetch({
        url: '/blog/article',
        method: 'post',
        data: data
    })
}

//文章根据ID获取API
export function getArticle({atcId, flag}) {
    return fetch({
        url: '/blog/article',
        method: 'get',
        params: {id: atcId}
    })
}

//文章根据ID获取API
export function praise(data) {
    return fetch({
        url: '/blog/article/praise',
        method: 'get',
        params: data
    })
}

//文章修改API
export function updArticle(data) {
    return fetch({
        url: '/blog/article',
        method: 'put',
        data: data
    })
}

//文章状态修改API
export function updAtcState(data) {
    return fetch({
        url: '/blog/article/state',
        method: 'put',
        params: data
    })
}

//文章删除API
export function delArticle(data) {
    return fetch({
        url: '/blog/article',
        method: 'delete',
        params: data
    })
}


//获取归档
export function archive(data) {
    return fetch({
        url: '/blog/article/archive',
        method: 'get',
        params: data
    })
}

export function download() {
    return fetch({
        url: "http://localhost:8217/cmbs/quanyi/dayRecordComparison/downloadFile?fileType=2&compareType=1&statementDate=20200422&comparisonChannel=1",
        method: "get"
    })
}